<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php $this->load->view('admin/header.html')?>
<script type="text/javascript" src="<?php echo base_url()?>common/js/validateForm.js"></script>
<script type="text/javascript">
    function Success(data) {
        $.Success(data);
    }
    //UE.getEditor('contents');
    $(function () {
        $.validate_contact('ajax_form');
    });
    function Del(cid) {
        layer.confirm("确定删除", function () {
            $.post("/admin/contact/delcontactmsg/" + cid, null, function (data) {
                var jsonData = $.parseJSON(data);
                if (jsonData.Statu == 'ok') {
                    Success(jsonData)
                }
                else {
                    Success(jsonData)
                }
            })
        }, function () {
            layer.msg('取消删除', { icon: 0 });
        })
    }
</script>
<div id="dcMain">
    <!-- 当前位置 -->
    <div id="urHere">
        DouPHP 管理中心
        <?php foreach($crumbs_items as $crumbs_item):?>
        <b>></b><a href="<?php echo $crumbs_item[0]?>"><?php echo $crumbs_item[1]?></a>
        <?php endforeach;?>
    </div>
    <div id="manager" class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
        <h3><?php echo end($crumbs_items)[1]?></h3>
        <form id="ajax_form" action="<?php echo site_url('admin/contact/edit_contact')?>" method="post">
            <input id="contact_id" name="contact_id" type="hidden" value="<?php echo !empty($contactModel)?$contactModel->contact_id:0?>" />
            <input id="menuid" name="menuid" type="hidden" value="<?php echo !empty($contactModel)?$contactModel->menuid  :$menuid?>" />
            <input id="mark" name="mark" type="hidden" value="<?php echo !empty($contactModel)?1:0?>" />
            <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
                <tr>
                    <td width="100" align="right">公司名称</td>
                    <td>
                        <input type="text" id="conpany_name" name="conpany_name" size="40" class="inpMain" value="<?php echo !empty($contactModel)?$contactModel->conpany_name:""?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">地址</td>
                    <td>
                        <input type="text" id="address" name="address" size="40" class="inpMain" value="<?php echo !empty($contactModel)?$contactModel->address:""?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">电话</td>
                    <td>
                        <input type="text" id="tel" name="tel" size="40" class="inpMain" value="<?php echo !empty($contactModel)?$contactModel->tel:""?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">手机</td>
                    <td>
                        <input type="text" id="phone" name="phone" size="40" class="inpMain" value="<?php echo !empty($contactModel)?$contactModel->phone:""?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">传真</td>
                    <td>
                        <input type="text" id="fax" name="fax" size="40" class="inpMain" value="<?php echo !empty($contactModel)?$contactModel->fax:""?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">邮箱</td>
                    <td>
                        <input type="text" id="email" name="email" size="40" class="inpMain" value="<?php echo !empty($contactModel)?$contactModel->email:""?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">QQ</td>
                    <td>
                        <input type="text" id="qq" name="qq" size="40" class="inpMain" value="<?php echo !empty($contactModel)?$contactModel->qq:""?>" /><span>多个qq以|分割</span>
                    </td>
                </tr>
               
                <tr>
                    <td></td>
                    <td>
                        <input type="submit" class="btn" value="<?php echo !empty($contactModel)?"修改":"添加"?>" />
                        <?php if(!empty($contactModel)){?>
                        <input type="button" class="btn" onclick="Del(<?php echo $contactModel->contact_id?>)" value="删除" />
                        <?php }?>
                         <input type="button" class="btn" value="返回" onclick="GoBack()" />
                    </td>
                </tr>
            </table>
        </form>
    </div>

</div>

